RAIS  3.2
C:/Projekte/RAIS/Specific Masks/Download.aspx.cs
Go to the documentation of this file.
00001 using System;
00002 using System.Collections;
00003 using System.Collections.Generic;
00004 using System.Configuration;
00005 using System.Data;
00006 using System.Linq;
00007 using System.Web;
00008 using System.Web.Security;
00009 using System.Web.UI;
00010 using System.Web.UI.HtmlControls;
00011 using System.Web.UI.WebControls;
00012 using System.Web.UI.WebControls.WebParts;
00013 using System.Xml.Linq;
00014 using RAIS.UI.Common;
00015 
00016 namespace RAIS.UI.SpecificMasks
00017 {
00021     public partial class Download : System.Web.UI.Page
00022     {
00023         protected void Page_PreLoad(object sender, EventArgs e)
00024         {
00025             RAIS.UI.Common.PageManagement.TrimTextBoxValues(this);
00026         }
00027         protected void Page_Load(object sender, EventArgs e)
00028         {
00029             if (Session[Constants.DOWNLOAD_FILES_LIST] != null && ((List<string>)Session[Constants.DOWNLOAD_FILES_LIST]).Contains(Request["FileName"]))
00030             {
00031                 string directory = ConfigurationManager.AppSettings["UploadDirectory"];
00032                 Response.Clear();
00033                 Response.ContentType = "text/plain";
00034                 Response.AddHeader("Content-Disposition", "attachment;filename=" + Request["FileName"]);
00035                 Response.WriteFile(directory + "\\" + Request["FileName"]);
00036                 Response.End();
00037             }
00038         }
00039     }
00040 }